// (async ()=>{
//     for(let i=0;i<2;i++){
//         await new Promise((resolve)=>{
//             setTimeout(() => {
//                 console.log('懂')
//                 resolve()
//             }, 1000);
//         }).then(async ()=>{
//             await new Promise(resolve=>{
//                 setTimeout(() => {
//                     console.log('da')
//                     resolve()
//                 }, 2000);
//             })
//         })
//     }
    
// })()


// let [taskNum ,waitNum]= readline().split(" ");
// taskNum = parseInt(taskNum);
// waitNum = parseInt(waitNum);
// let taskList = readline().split(" ");
// let waitList = []
// for(let i = 0; i < waitNum; i++){
//     let temp = parseInt(readline())
//     waitList.push(temp)
// }
/* let taskNum = 7
let waitNum = 4
let taskList = [1,2,3,1,2,3,1]
let waitList = [1,8,11,14]
for(let i = 0; i <waitNum; i++){
    let sum = 0
    let index = 0 //完成任务数量
    let waitTime = waitList[i]
    for(let j = 0; j < taskList.length; j++){
        sum += parseInt(taskList[j])
        if(sum <= waitTime){
            index ++
            if(j === taskList.length - 1) console.log(index)
        }else{
            console.log(index,new Date())
            break
        }
    }
} */

//console.log(taskNum,waitNum,taskList,waitList);

/* let a = new Promise((resolve,reject)=>{
    setTimeout(() => {
        resolve('a执行完成')
    }, 1000);
})

let b = new Promise((resolve,reject)=>{
    setTimeout(() => {
        resolve('b执行完成')
        // reject('b执行完成')
    }, 2000);
})

let c = new Promise((resolve,reject)=>{
    setTimeout(resolve, 3000,'c执行完成');
}) */

/* Promise.all([a,b,c]).then(res=>{
    console.log(res)
}).catch(err=>{
    console.log(err)
}) */

/* Promise.race([]).then(res=>{
    console.log('res',res)
}).catch(err=>{
    console.log('err',err)
}) */















/* let [taskNum ,waitNum]= readline().split(" ");
taskNum = parseInt(taskNum);
waitNum = parseInt(waitNum);
let taskList = readline().split(" ");
let waitList = []
for(let i = 0; i < waitNum; i++){
    let temp = parseInt(readline())
    waitList.push(temp)
}
let index = 0 //完成任务数量，
let tag = 0 //表示当前任务已经是可以完成的最后一个
let sum = 0
// 优化，每次不需要从头开始找，接着上一次的位置开始就行，因为时间越来越大，之前计算过的肯定是符合要求的
for(let i = 0; i <waitNum; i++){
    let waitTime = waitList[i]
    for(let j = index; j < taskList.length; j++){
        sum += parseInt(taskList[j])
        if(sum <= waitTime){
            index ++
            if(j === taskList.length - 1) {
                console.log(index)
                break
            }
        }else{
            console.log(index)
            sum -= parseInt(taskList[j])
            break
        }
    }
}

//console.log(taskNum,waitNum,taskList,waitList); */


// let size = document.querySelector('.inner')
// console.log(size.style.fontSize = '30px')


// 实现归并排序 下面两种不同方法
/* function Joi(arr1,arr2){
    let i = 0
    let j = 0
    let len1 = arr1.length
    let len2 = arr2.length
    let result = []
    // debugger
    for(;i<len1&&j<len2;){
        if(arr1[i] > arr2[j]){
            result.push(arr2[j])
            j++
        }else{
            result.push(arr1[i])
            i++
        }
    }
    if(i < len1){
        for(i;i<len1;i++){
            result.push(arr1[i])
        }
    }else if(j < len2){
        for(j;j<len2;j++){
            result.push(arr2[j])
        }
    }
    return result
}

let arr1 = [1,3,5,7]
let arr2 = [2,3,4,6,8,9,11,13]
let re = Joi(arr1,arr2)
console.log(re) */
/* function Sort(nums1,nunms2) {
    let all_length = nums1.length + nunms2.length
    let arr = []
    
    let t1 = 0
    let t2 = 0
    let n1_length = nums1.length
    let n2_length = nunms2.length
    for(let i =0 ;i<all_length;i++){
        if(t1<n1_length&&t2<n2_length) {
            if(nums1[t1]>nunms2[t2]) {
            arr.push(nunms2[t2])
            t2++
            } else {
                arr.push(nums1[t1])
                t1++
            }
        } else {
            if(t1 < n1_length){
                arr = arr.concat(nums1.slice(t1,nums1.length))
                break
            } else if (t2 < n2_length) {
                arr = arr.concat(nums2.slice(t2,nums2.length))
                break
            }
        }
        
    }
    return arr
}

var nums1 = [1,2,3,4,7,13,16,18]

var nums2 = [2,5,6,9]

console.log(Sort(nums1,nums2)) */



// let str = 'rain'
// let words = 'You say that you love rain,but you open your umbrella when it rain'
// let temp = /[str]/g
// let a = words.match(temp)
// // document.querySelector('').addEventListener('')
// // document.createElement('em').innerHTML
// // let dom = document.querySelector('.input')
// // dom.addEventListener('input',function(){
// //     console.log(dom.value)
// // })
// let dom = document.querySelector('.test')
// let text = dom.textContent
// console.log(dom.textContent)
// let res = text.replace('h',`<em>ddd</em>`)
// dom.innerHTML= res
// let [words,str] = readline().split(":")
//console.log(words)
//console.log(str)
/* let str = 'rain'
let words = 've rain,it rain' */
/* let temp = `/${str}/g`
let re = eval(temp)
let a = words.match(re)
if(a.length){
    console.log(a.length)
}else{
    console.log(0)
} */
/* 4
1 2 3
4 2 3
108 2 3
108 1 40000

2
6
162
108
Math.floor()
Math.ceil
Math.max
Math.pow()
parseInt
let nw = words.split(" ")
console.log(nw)
let len = nw.length
let re = 0
for(let i = 0; i < len; i++){
    // debugger
    if(nw[i].split(",").includes(str)) re++
    console.log(nw[i].split(","))
}
console.log(re) */
/* a = {1,2,3,4}
function solve( k ,  a ) {
    // write code here
    let list = []
    for(let i in a)
        list.push(i)
    let max1 = Math.max(...list)
    let max2 = Math.max(...list.filter(item => {
        item != max1
    }))
    return Math.max(Math.pow(max1,max2)*k + (max1 * max2),Math.pow(max2,max1)*k + (max2 * max1))
} */


function Person(name,age){
    this.name = name
    this.age = age
}
Person.prototype.fun = function(){
    console.log('我是Person')
}
Person.prototype.say = function(){
    console.log('我是'+this.name+'你好')
}
Student.prototype = new Person()
// Student.prototype.constructor = Student
function Student(name,age,grad){
    Person.call(this,name,age)
    this.grad = grad
}
let ns = new Student(name='小k',age=12,grad='高中')
console.log(ns)
ns.say()
let p = new Person(name='小米',age=12)
console.log(p)